import 'package:flutter/material.dart';
import 'package:shortmovieapp/data/viewData.dart';
import 'package:shortmovieapp/myPages/shareView.dart';
import 'package:tapped/tapped.dart';

import 'selectText.dart';

class TikTokHeader extends StatefulWidget {
  final Function? onSearch;
  const TikTokHeader({
    Key? key,
    this.onSearch,
  }) : super(key: key);

  @override
  _TikTokHeaderState createState() => _TikTokHeaderState();
}

class _TikTokHeaderState extends State<TikTokHeader> {
  int currentSelect = 0;
  @override
  Widget build(BuildContext context) {
    // List<String> list = ['推荐', '本地'];
    // List<Widget> headList = [];
    // for (var i = 0; i < list.length; i++) {
    //   headList.add(Expanded(
    //     child: GestureDetector(
    //       child: Container(
    //         child: SelectText(
    //           title: list[i],
    //           isSelect: i == currentSelect,
    //         ),
    //       ),
    //       onTap: () {
    //         setState(() {
    //           currentSelect = i;
    //         });
    //       },
    //     ),
    //   ));
    // }

    return Row(mainAxisAlignment: MainAxisAlignment.start, children: [
      Container(
        // padding: EdgeInsets.symmetric(horizontal: 16),
        alignment: Alignment.centerLeft,
        child: searchButton(alignment: Alignment.centerLeft,
          onClick: () => Navigator.of(context).pushNamed(MyPageRoute.seach),
        ),
      )
    ]);
  }
}
